package com.newsmanagement.mapper;

import com.newsmanagement.domain.pojo.NodeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newsmanagement.domain.vo.NodeProvVo;
import com.newsmanagement.domain.vo.NodeTypeVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
* @author adim
* @description 针对表【node_info(节点企业信息表)】的数据库操作Mapper
* @createDate 2025-10-09 13:57:08
* @Entity com.newsmanagement.domain/pojo.NodeInfo
*/
@Mapper
public interface NodeInfoMapper extends BaseMapper<NodeInfo> {


    int updateNodeInfo(NodeInfo nodeInfo);

    @Delete("DELETE FROM node_info WHERE node_id = #{id}")
    int removeNodeInfoById(Integer id);


    @Select("SELECT COUNT(*) FROM node_info WHERE create_time >= #{startDate} AND create_time < #{endDate}")
    Integer countByMonth(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

    List<NodeProvVo> countByProvince();

    List<NodeTypeVo> countByNodeType();



}




